home *** CD-ROM | disk | FTP | other *** search
- Path: news.sinet.slb.com!usenet
- From: "Vinh D. Nguyen" <vnguyen@sugar-land.anadrill.slb.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Help, C++ '&' dereferencer
- Date: Mon, 11 Mar 1996 18:27:04 -0600
- Organization: Schlumberger Anadrill
- Message-ID: <3144C4D8.18DC@sugar-land.anadrill.slb.com>
- References: <4i153m$pgf@bignews.shef.ac.uk>
- NNTP-Posting-Host: 163.185.118.40
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Eric Smith wrote:
- >
- > My manuals and online help is a little vague on this one so can anyone
- > please simply explain to me what the & sign ( or 'dereferencer' I believe)
- > is doing in the following command line where 'value' should end up as 1 or 0.
- >
- > value=((inportb(0x1B4) & 0x20)>>5);
-
- Your & operator in this context, my friend, is the bitwise AND operator.
- What you are doing is to perform a bit-by-bit AND of inportb(0x1B4) and 0x20
- and then shifting the result right by 5 bits.
-
- I hope this helps.
-
- --
- --------------------------------------------------------------------------
- * Vinh Nguyen vnguyen@slb.com *
- * Drilling Information Products - Senior Engineer *
- * 200 Gillingham Ln. (713) 275-7524 (Office) *
- * Sugarland, TX 77478 (713) 275-8098 (FAX) *
- --------------------------------------------------------------------------
-